UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JeF8iAKVAAR04l5Q+QfsiIUSLe7SFzePb3qtxzKA9vA=' 
WHERE 
  key_id = '8042968c77801527d8b55bb16887561989dec7bc8141ce800cf86be3b2aa1dc8' 
  AND (
    token = 'JeF8iAKVAAR04l5Q+QfsiIUSLe7SFzePb3qtxzKA9vA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040