UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XPbTeeXQSd6NF7C8S/lhE9Ky0T2qGUup0oPZTrt7/A0=' 
WHERE 
  key_id = '219619a5b2388ebe06e9464694b89bb442ad99f92136296d119d24d46cf56b99' 
  AND (
    token = 'XPbTeeXQSd6NF7C8S/lhE9Ky0T2qGUup0oPZTrt7/A0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050