UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LSS4vK4+6QUu596BoVu4bBWSH5HzYMwh6a9WoQmaUqw='
WHERE
key_id = 'dfa90c9422c157d001ac56360e1b98cc7f557e7d4ece8a4d6dc0cb536d9cbb34'
AND (
token = 'LSS4vK4+6QUu596BoVu4bBWSH5HzYMwh6a9WoQmaUqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)