UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M6QRyOugGH56lqwUnFaaRulfDSoFbrORSeBZeuNOqiA='
WHERE
key_id = '403b35ab55b30949400e2d2cbed086ba5dd3ca997316163dffb303835949be98'
AND (
token = 'M6QRyOugGH56lqwUnFaaRulfDSoFbrORSeBZeuNOqiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)