UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Viu4Oeaq9kV1AzUyDNLra71kOjmY55RHoQEhsiJcQng=' 
WHERE 
  key_id = '0d5a2d83a58a4db78f5333ef54f666f276209fe02848d296c021c2ed3c151ee6' 
  AND (
    token = 'Viu4Oeaq9kV1AzUyDNLra71kOjmY55RHoQEhsiJcQng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027