UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D2Jl3DOliAkGDbqzeQdOUzi1I7uTF8zADKwgm7GEzVk='
WHERE
key_id = '9cd722801788a7afabd77f7211e1d42a1a7e1a650885c36b41eb5889328db8db'
AND (
token = 'D2Jl3DOliAkGDbqzeQdOUzi1I7uTF8zADKwgm7GEzVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)