UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KmUotD2hh7fmI+/oN0k1M7xv2R58t1mhcj5+CD1RvNA='
WHERE
key_id = '5514e2d810c97962ab1a7ec16e6dc77646ac53a4e92807ba4a75445d88bf93cf'
AND (
token = 'KmUotD2hh7fmI+/oN0k1M7xv2R58t1mhcj5+CD1RvNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)