UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NehtaRTQUWBNiKJO+3NAW9vn5PxLvwS2Zyrh9FdIcJU='
WHERE
key_id = 'ad54fd2436e0f5e1dde95649753a0447ca88fc04ef83dbed712825e2a68a003f'
AND (
token = 'NehtaRTQUWBNiKJO+3NAW9vn5PxLvwS2Zyrh9FdIcJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)