UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kOHaF5F7XuaOziHKvxIPmElQiM7UYuf4RsphPeXM+aA='
WHERE
key_id = '7d269f8ec5b53dd50af2748b2695e60285fce17e2eb5ad2072147df1de0e885e'
AND (
token = 'kOHaF5F7XuaOziHKvxIPmElQiM7UYuf4RsphPeXM+aA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)