UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9+jOeaJrSRD15L/K90IUXR6p8DDol7pCytsAKw80s5Q=' 
WHERE 
  key_id = 'e4a9b8bc397ed68f4f22a1d179793366b8cd60581b1a8a3b97358f287627b7c6' 
  AND (
    token = '9+jOeaJrSRD15L/K90IUXR6p8DDol7pCytsAKw80s5Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036