UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OHtV3xsdvGlmSICv4LpSFIJxlFWifqN3bI6LmyqzHLM=' 
WHERE 
  key_id = '13db89c9a9b1d019153adca7d8e51401a8842d6cbd44de974b3ea4152b30c59e' 
  AND (
    token = 'OHtV3xsdvGlmSICv4LpSFIJxlFWifqN3bI6LmyqzHLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030