UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4GLPsT4TamFjeMTdEeRSjW5vOzDvGVioc+Fo5jD3LKc='
WHERE
key_id = 'e517d1d68f93ac0a93eabf108fbed170e23441f891dcac87b124f9ed749a1af6'
AND (
token = '4GLPsT4TamFjeMTdEeRSjW5vOzDvGVioc+Fo5jD3LKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)