UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lMy+9Bt2N2nj4eKO9U8WY+ky8QlzFuEzJtQMpHToxnY='
WHERE
key_id = 'b4d17dde6171bc1a932f57b013c19c60cb0c5431991ab4dd4d3bef345e1f0378'
AND (
token = 'lMy+9Bt2N2nj4eKO9U8WY+ky8QlzFuEzJtQMpHToxnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)