UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z3FfqzwV9wqrVxQ91VQfWFSv+IVuIEGBWACggslK6y0='
WHERE
key_id = '2e37b59962a3584dc68b75a1da0ed40b6c3dbb6235eae59d465c96ea74f13dbf'
AND (
token = 'Z3FfqzwV9wqrVxQ91VQfWFSv+IVuIEGBWACggslK6y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)