UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vLXMLT30pkLmawkLFjGL9c8+reBLejkB+W08eL0R5kY=' 
WHERE 
  key_id = '572865da7edd05de6e2cde1e2025f8c021ace1174fec50c7a42ef9fba79a2b8c' 
  AND (
    token = 'vLXMLT30pkLmawkLFjGL9c8+reBLejkB+W08eL0R5kY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031