UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's3A9D/7EZsgyhREZVQee48NNG+i9b96UmBqEbeT1INw='
WHERE
key_id = 'e50b99f867aef6bee7025609b79c16b8f402dff2eb2a501d21ecb2e99e7eff5c'
AND (
token = 's3A9D/7EZsgyhREZVQee48NNG+i9b96UmBqEbeT1INw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)