UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dd5T4LnaYWM5wxxxkqp5/Xbs6EV9Fj5uKOHBmY1aMPo='
WHERE
key_id = 'e8850a516a9ede3ba91a67457cb4d2e656431833951f8f8b9d96deb73676802f'
AND (
token = 'Dd5T4LnaYWM5wxxxkqp5/Xbs6EV9Fj5uKOHBmY1aMPo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)