UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qt0nRT/bT6JvgbzPHK8XgAsViGYy7lkq5+AuHZu4IQ0=' 
WHERE 
  key_id = '6fae932eb170ec26b76f6e54235d98ac32c157e905bf1b5f896e9864bc37a9dc' 
  AND (
    token = 'Qt0nRT/bT6JvgbzPHK8XgAsViGYy7lkq5+AuHZu4IQ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037