UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OLGWLNA9RGoITrT/yEx/cMnYsMMbPjxZidlVnLEd9xI='
WHERE
key_id = '689f6f2e1bf7b7a1950fd32f3991bbbf1a7062730b98aa1cd6c9a923a0886c04'
AND (
token = 'OLGWLNA9RGoITrT/yEx/cMnYsMMbPjxZidlVnLEd9xI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)