UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pVH7aVl+CWIEJGX7G9NemM2G8isKOpnCOxeCjk9dhGk=' 
WHERE 
  key_id = 'dc49db9acc9f149244680f680606e642fc78ce9774252a69f3bdbeb1738a749c' 
  AND (
    token = 'pVH7aVl+CWIEJGX7G9NemM2G8isKOpnCOxeCjk9dhGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024