UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's39i/2DlIbwW7QACjjOOsSIp/KGKsMPP+zL5oZQZGMU='
WHERE
key_id = '995a186bacc19f94c4e82026e3cec2b41b57b56adb986cb8985fb57f7a469c56'
AND (
token = 's39i/2DlIbwW7QACjjOOsSIp/KGKsMPP+zL5oZQZGMU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)