UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZtOcTkrz5c+UCtZiTJdjdcXMFctFGHK6/c8E4NhBRRY=' 
WHERE 
  key_id = '0b76b0a33a0de92996ad8581edde3b7dcb91ed6b33bd2e8dfe40cc5c9747c893' 
  AND (
    token = 'ZtOcTkrz5c+UCtZiTJdjdcXMFctFGHK6/c8E4NhBRRY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046