UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IrP0QTMZMOgUUIDXKa7II5L1hovVDzhlzXtuYbNoILs=' 
WHERE 
  key_id = '42273ffd390bb52640ae75eac6ff02849bc67df4f3043e6d3d987c2a7bcfde77' 
  AND (
    token = 'IrP0QTMZMOgUUIDXKa7II5L1hovVDzhlzXtuYbNoILs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046