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