UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8RM78b13jmmRMRAhgnL4mxWfAn3fHu7k/QskxbRuY88=' 
WHERE 
  key_id = '0a2208e8b566d5de796cca5a48e7cfd3dc6d61356fb575d12c5d0b89abf172f7' 
  AND (
    token = '8RM78b13jmmRMRAhgnL4mxWfAn3fHu7k/QskxbRuY88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030