UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pe7LNfNm4Sw7V7WIFGqJkT4uRPkjh8vr65T1G4V0XMk='
WHERE
key_id = '54aa0a2f6d47f9a2b6233a028d19d6a68ecd4e2ffc18df944edb65d8bcb75f89'
AND (
token = 'pe7LNfNm4Sw7V7WIFGqJkT4uRPkjh8vr65T1G4V0XMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)