UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G2EwKhnoW7jyr/hKsBCWK3+M35WSYDwFxbmmB5NX+l0='
WHERE
key_id = 'cca13a812e3e8374d0eadd45a1b4fc01a7143895c363f1cbb28524db8e856805'
AND (
token = 'G2EwKhnoW7jyr/hKsBCWK3+M35WSYDwFxbmmB5NX+l0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)