UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LaHcYsjpBorVHFK5Z6L7iuWhfZrGPX3xTqCtHzpzBd4=' 
WHERE 
  key_id = '91cf221f5a414ae3598747f4ca9b0f879f923089b47e07e7ab24e309023be5ec' 
  AND (
    token = 'LaHcYsjpBorVHFK5Z6L7iuWhfZrGPX3xTqCtHzpzBd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046