UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9OC5VNZABwVqWhg/i6jxgEKeiCM9Svgw1E+/W2CGApE='
WHERE
key_id = '04f2cfb65335e5c57e590fdef2269797adf8512071fae17c71c64a3f6c2283f2'
AND (
token = '9OC5VNZABwVqWhg/i6jxgEKeiCM9Svgw1E+/W2CGApE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)