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