UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8HYUDt0vPf7GbmXxJcGAthhYb3JANBhb7HUK3xvNPxw='
WHERE
key_id = '81c8f910cff6f6dc949744693bba3f6bda5b665c7e91bed208989224b6d52035'
AND (
token = '8HYUDt0vPf7GbmXxJcGAthhYb3JANBhb7HUK3xvNPxw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)