UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VImF2Q1+okeNjxNzr5kgpXdOLrByMpeEshWIhMKfUbk='
WHERE
key_id = '23e2bf7195856b8cda28d3f380fa794eeaf85068dd231fbe4f524a4455a085c3'
AND (
token = 'VImF2Q1+okeNjxNzr5kgpXdOLrByMpeEshWIhMKfUbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)