UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fpm7grLoIvUIOnZsf/bUHMLkkTopzCu9i6B/7ct0LrQ=' 
WHERE 
  key_id = 'e9552b7211cfc47950472fe338e5d6323b075c1d967eef9a1476b6bc4992e002' 
  AND (
    token = 'Fpm7grLoIvUIOnZsf/bUHMLkkTopzCu9i6B/7ct0LrQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025