UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VSAy26Dh1WNFx9CpYjVuOC5IuP0fD4fCiAvJIxoKRJQ='
WHERE
key_id = '023a97c8750429f83eeb61d9e9b1d9e1701f4fbe77a2677569c130e696f40ddc'
AND (
token = 'VSAy26Dh1WNFx9CpYjVuOC5IuP0fD4fCiAvJIxoKRJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)