UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7mopMm+FGkGOFchr+3KmrdYnYi37MxB8SvJifI8Jl4c='
WHERE
key_id = 'd1d32b848277fdd7bf952c1e648d9775dd257f03b8d8db75aa306ce70e52e3d4'
AND (
token = '7mopMm+FGkGOFchr+3KmrdYnYi37MxB8SvJifI8Jl4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)