UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aGwrhpHdeLzhvgEVASWnWNO4jYBGUCv8z9m57WR/KLE=' 
WHERE 
  key_id = 'c48469d0169fa0c6ea6df2abef5a0d774015896d4dc56acf3e9788b979e4c833' 
  AND (
    token = 'aGwrhpHdeLzhvgEVASWnWNO4jYBGUCv8z9m57WR/KLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027