UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hus3Z8nhSOJ8z0BmwgJ586eSaoOme/wYRbVMDQQrTtk='
WHERE
key_id = '20ff47ee24cc8d3fdf8104eae213af8db9998932b0498c3481317ceca9b02460'
AND (
token = 'hus3Z8nhSOJ8z0BmwgJ586eSaoOme/wYRbVMDQQrTtk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)