UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UUP673v41ZffKlApo5bdKeNMR59sbkG67T5eyEVRJJc=' 
WHERE 
  key_id = 'd2bf1c64b40b4f5780821ab7d3eea5b910d95a2bcea336e10333d688b27a5fba' 
  AND (
    token = 'UUP673v41ZffKlApo5bdKeNMR59sbkG67T5eyEVRJJc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031