UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U7te+qr6XrS8In/CiwsCtn+WFQu26hk6T8m1eu0GIaM='
WHERE
key_id = '9ec0f1adb5666810b733d28faf609cb137fa36796b74ec0905a2b6c4f6fdf332'
AND (
token = 'U7te+qr6XrS8In/CiwsCtn+WFQu26hk6T8m1eu0GIaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)