UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm0JZ+GWb6kt6NqrRmkmhYS0oRrfGbDv2HOcrF26ahD0='
WHERE
key_id = 'b4b6ffe1d6123af1214692676104d71e5a83e0e2d2be70e1b8c72d914c0f8ba4'
AND (
token = 'm0JZ+GWb6kt6NqrRmkmhYS0oRrfGbDv2HOcrF26ahD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)