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