UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4lBH8O5FztKaW7z4Puaq65F/R7JUulWlTAWagKesP3I='
WHERE
key_id = '9e5e9b713da92f2282e2cbabb69b892cf5c39b4ad23579ab83891ec105188cf1'
AND (
token = '4lBH8O5FztKaW7z4Puaq65F/R7JUulWlTAWagKesP3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)