UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YU/AFTo8DLDEsAyw2AUk7hEiflBjtyhtf4jX9wmjLyQ=' 
WHERE 
  key_id = 'e7bb4f3c31200eaf2808fd2edf1a0681fb965eedb05cae4ba4867a5d6b79e4aa' 
  AND (
    token = 'YU/AFTo8DLDEsAyw2AUk7hEiflBjtyhtf4jX9wmjLyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020