UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2J2MJW5oRM7+YJVi/ppRkpzlPkzWqsnIxOvRDl6PREY=' 
WHERE 
  key_id = '6cecd757a7c7472cbc3638b7362203b0fb0a431c92a4e350d35348ec0c47e23e' 
  AND (
    token = '2J2MJW5oRM7+YJVi/ppRkpzlPkzWqsnIxOvRDl6PREY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027