UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W/nzpnSt3gkGRRS1Y67alA4xOFus8+wZIevrVicD9Xw='
WHERE
key_id = '753f3ab14c29c1c4fce272156af1e2bb8b2034db1f64240a98bb6e952529da6e'
AND (
token = 'W/nzpnSt3gkGRRS1Y67alA4xOFus8+wZIevrVicD9Xw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)