UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cd6IZ3pzzIgldZEmJlMYYKSra+pe7nFGoASDJhxyrsQ='
WHERE
key_id = 'ea6dce449eeae1cffa3b4067bf79cb58e44440cc97a9d24773eb29ad9f24ba43'
AND (
token = 'cd6IZ3pzzIgldZEmJlMYYKSra+pe7nFGoASDJhxyrsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)