UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8V0VkmrPWMlPaUvBlbAj4lN0fHk5ILc3hTSqphoI63Y='
WHERE
key_id = 'da502957d5590022fcff7ad8e4d7dffc1f2c8e7079dc0baca56ae01490d2c015'
AND (
token = '8V0VkmrPWMlPaUvBlbAj4lN0fHk5ILc3hTSqphoI63Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)