UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uhyOuSlXEoyrF6FYzJR2yGBhuTZbvxsXj4P3y3M28qQ='
WHERE
key_id = 'fb93419d8469b927d1303a13035601fd4efb890e88a5410fa4eaa9da5287dbf6'
AND (
token = 'uhyOuSlXEoyrF6FYzJR2yGBhuTZbvxsXj4P3y3M28qQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)